// **********************************************************************
//                            Project Nitro
//                        ---------------------
//
//  File        : Screen.h
//  Description : Screen
//  Author      : Guillaume Delhumeau <guillaume.delhumeau@gmail.com>
//  License     : GNU General Public License 3
//
// **********************************************************************

#ifndef _SCREEN_H_
#define _SCREEN_H_

#include <ClanLib/core.h>
#include <ClanLib/display.h>

class GameEngine;

class Screen{

public:

	Screen();

	void manage_window(GameEngine & game_engine);

	inline void draw(CL_Sprite & sprite, float x, float y)
	{
		sprite.draw(get_gc(), x, y);
	}
	
	inline void draw_inversed(CL_Sprite & sprite, float x, float y)
	{ 
		sprite.draw(get_gc(), x, (float)get_gc().get_height() - y); 
	}

	inline CL_GraphicContext & get_gc(){ return _main_window.get_gc(); }

	inline CL_InputContext & get_ic(){ return _main_window.get_ic(); }

	inline float get_time_elapsed(){ return _time_elapsed; }

	void display();

	inline void clear(){get_gc().clear();}

	inline void clear(CL_Colorf & color){get_gc().clear(color);}

private:

	/**
	* Window
	*/
	CL_DisplayWindow _main_window;


	CL_Slot _quit_event;

	int _width;
	int _height;

	unsigned int _time_last_frame;

	float _time_elapsed;

};

#endif
